package com.example.model.pojo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 用户实体类，对应数据库user表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(name = "用户实体类", description = "系统用户信息，对应数据库user表")
public class User {
    @Schema(description = "用户ID，主键", required = true, example = "1")
    private Integer id;             // 用户ID，主键
    
    @Schema(description = "用户真实姓名", required = true, example = "张三")
    private String name;            // 用户姓名
    
    @Schema(description = "学号，学生用户必填", example = "20220001")
    private String studentId;       // 学号，学生用户必填
    
    @Schema(description = "工资号，教师用户必填", example = "T2023001")
    private String teacherId;       // 工资号，教师用户必填
    
    @Schema(description = "密码，加密存储", required = true, example = "hashed_password")
    private String password;        // 密码，加密存储
    
    @Schema(description = "用户角色: 0-学生, 1-教师", required = true, example = "0")
    private Integer role;           // 用户角色: 0-学生, 1-教师
    
    @Schema(description = "班级名称，学生用户必填", example = "计算机科学与技术1班")
    private String className;       // 班级名称，学生用户必填
    
    @Schema(description = "用户电子邮箱", example = "zhangsan@example.com")
    private String email;           // 电子邮箱
    
    @Schema(description = "用户创建时间", required = true, example = "2023-09-01T10:00:00")
    private LocalDateTime createdAt;         // 创建时间
}